<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/5/21 0021
  Time: 10:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">

<head>
    <title>Tables</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <%@ include file="/common/include_css.jsp"%>
</head>

<body>
<!-- WRAPPER -->
<div id="wrapper">

    <!-- NAVBAR -->
    <%@ include file="/common/include_navbar.jsp"%>
    <!-- END NAVBAR -->


    <!-- LEFT SIDEBAR -->
    <%@ include file="/common/include_sidebar.jsp"%>
    <!-- END LEFT SIDEBAR -->


    <!-- MAIN -->
    <div class="main">
        <!-- MAIN CONTENT -->
        <div class="main-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <!-- BASIC TABLE -->
                        <div class="panel">
                            <div class="panel-heading">
                                <h3 class="panel-title">图片上传</h3>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <td>商品名称</td>
                                            <td>${goods.gname}</td>
                                            <td>商品标题</td>
                                            <td>${goods.goodsInfo}</td>
                                        </tr>
                                        <tr>
                                            <td>商品价格</td>
                                            <td>${goods.price}</td>
                                            <td>商品库存</td>
                                            <td>${goods.num}</td>
                                        </tr>
                                        <tr>
                                            <td>商品分类</td>
                                            <td>${goods.type_name}</td>
                                            <td>商品详情</td>
                                            <td>${goods.goods_deltis}</td>
                                        </tr>
                                    </tbody>
                                </table>
                                <h3 class="panel-title">商品图片</h3>
                                <c:forEach var="img" items="${imglist}">
                                <div style="width: 230px;float: left;margin-left: 20px">
                                     <img src="${img.file_url}" alt="" width="220px" height="220px"></img>
                                    <a href="${pageContext.request.contextPath}/goods_image/delete_image?id=${img.id}">
                                        <span class="badge" style="font-size: 14px;"><i class="lnr lnr-cog"></i>&nbsp;&nbsp;删除</span></a>
                                </div>
                                </c:forEach>

                                <div style="clear: both; margin-top: 260px;">
                                <form action="${pageContext.request.contextPath}/goods_image/upload_image" method="post" enctype="multipart/form-data">
                                    <input type="hidden" name="id" value="${goods.id}">
                                    <div class="form-group">
                                        <label for="picture" class="col-sm-2 control-label">请选择图片</label>
                                        <div class="col-sm-5">
                                            <input type="file" name="picture" class="form-control" id="picture">
                                        </div>
                                        <div class="col-sm-2">
                                            <button type="submit" class="btn btn-primary">保存</button>
                                        </div>
                                    </div>
                                </form>
                                </div>
                            </div>
                        </div>
                        <!-- END BASIC TABLE -->
                    </div>

                </div>
            </div>

        </div>
    </div>
    <!-- END MAIN CONTENT -->
</div>
<!-- END MAIN -->
<div class="clearfix"></div>
<footer>
    <div class="container-fluid">
        <p class="copyright">Copyright &copy; 2020.本项目归1802班同学所有，未经允许不得转载，违者必究 </p>
    </div>
</footer>
</div>
<!-- END WRAPPER -->
<!-- Javascript -->
<%@ include file="/common/include_javascript.jsp"%>
</body>

</html>
